﻿@{
    ViewBag.Title = "邮箱";
    Layout = "~/Views/Shared/_GridCommonLayout.cshtml";   
}
<link href="~/CSS/Jcrop/fineuploader.css" rel="stylesheet" />

<style type="text/css">
    /*写邮件页面  by zjb 2014/7/30 */
    .email-open-header {
        padding: 15px;
    }

    .form-horizontal .form-group .control-label {
        padding-top: 7px;
        text-align: left;
    }
    /*.dropdown-menu {
    z-index:1001; 
    }*/
    /* 写邮件页面  end  */
    .inbox-message {
        z-index: 999;
    }

    .folders {
        background-color: #BBBBBB;
        border-radius: 7px 7px 7px 7px;
        font-size: 0;
        list-style-type: none;
        margin: 10px 0 16px;
        padding: 0;
    }

        .folders li:hover {
            background-color: #DDDDDD;
        }

        .folders li:first-child {
            border-left: medium none;
            border-radius: 7px 0 0 7px;
        }

        .folders li {
            border-left: 1px solid #DDDDDD;
            border-right: 1px solid #888888;
            color: #444444;
            cursor: pointer;
            display: inline-block;
            font-size: 16px;
            font-weight: bold;
            padding: 0.5em 1.5em;
            text-shadow: 0 1px 1px #F7F7F7;
        }

        .folders li {
        }

        .folders .selected {
            background-color: #444444 !important;
            border-left: medium none;
            border-right-color: #AAAAAA;
            box-shadow: 1px 2px 6px #070707 inset;
            color: #FFFFFF;
            text-shadow: none;
        }

    .mails tr:nth-child(2n) {
        background-color: #EEEEEE;
    }

    .mails tbody tr:hover {
        background-color: #6688CC !important;
        color: #FFFFFF;
        cursor: pointer;
    }

    .viewMail .mailInfo {
        background-color: #DAE0E8;
        border-radius: 1em 1em 1em 1em;
        padding: 1em 1em 0.5em 1.25em;
    }

        .viewMail .mailInfo h1 {
            font-size: 130%;
            margin-top: 0.2em;
        }

        .viewMail .mailInfo label {
            color: #777777;
            display: inline-block;
            font-weight: bold;
            min-width: 2.75em;
            text-align: right;
        }

    .viewMail .message {
        padding: 0 1.25em;
    }


    /*已读邮件和未读邮件的标志显隐*/
    .table-wrap .fa-envelope-o {
        display: none;
    }

    .noRead .fa-envelope-o {
        display: inline-block;
    }

    .noRead {
        font-weight: bolder;
    }
    /*附件图标的显隐 */
    .unshowIcon {
        display: none;
    }
    /*是否显示邮件简略信息的div*/
    .UnShowDiv {
        display: none;
    }
</style>


<input type="hidden" id="vbEmail" value="@ViewBag.email" />
<div id="inbox-content" class="inbox-body no-content-padding">
    <!-- 左边栏 -->
    <div class="inbox-side-bar">
        <h3 class="page-title txt-color-blueDark hidden-tablet"><i class="fa fa-fw fa-inbox"></i>平台管理邮箱 &nbsp;</h3>
        <a href="javascript:void(0);" id="compose-mail" data-bind="click: $root.NewLetter" class="btn btn-primary btn-block">
            <strong>写信</strong> </a>

        <ul id="mailList" class="inbox-menu-lg">
            <li id="firstID" onclick=" gdViewModel.goToFolder('收件箱');">
                <a href="javascript:void(0);">收件箱 </a>
            </li>

            <li id="secondid" onclick="gdViewModel.goToFolder('发件箱');">
                <a href="javascript:void(0);">发件箱</a>
            </li>
            <li id="thirdid" onclick="gdViewModel.goToFolder('草稿箱');">
                <a href="javascript:void(0);">草稿箱</a>
            </li>
        </ul>

    </div>



    <!-- 邮件列表显示部分 -->
    <div class="table-wrap custom-scroll animated fast fadeInRight">
        <!--邮箱简略信息-->

        <!--test8.28显示当前收件箱属性，一共有多少封邮件，当未读的时候要显示未读邮件有多少数据-->
        <div id="SimInfo" style="height: 20px; width: 300px;" data-bind="html:$root.mailHeader">
        </div>


        <div id="ShowMailList">

            <div style="margin-bottom: 10px;">
                <!-- 工具栏 -->
                <div class="inbox-checkbox-triggered">

                    <div class="btn-group">
                        <!-- Single button -->
                        <div class=" btn btn-default dropdown-toggle " data-original-title="选择" data-placement="bottom" data-toggle="dropdown" title="">
                            <label id="tableCheck" data-bind="click:$root.toggleChecks">
                                <input type="checkbox" name="mailSelector" class="checkbox style-2" /><span></span></label>
                            <span class="dropdown-toggle"><i class="fa fa-angle-down "></i></span>
                        </div>

                        <ul class="dropdown-menu" role="menu" style="left: 0;">
                            <li><a href="#" data-bind="click:$root.checkAllMail">全选</a></li>
                            <li><a href="#" data-bind="click:$root.unCheckAllMail">全不选</a></li>
                        </ul>
                        <!--修改的部分-->

                        <!--垃圾桶-->
                        <a style="height: 39px" class="deletebutton btn btn-default" rel="tooltip" href="javascript:void(0);" data-bind="click:$root.onDataDeleting">
                            <strong><i class="fa fa-trash-o fa-lg"></i></strong></a>

                        <div class="pull-right">
                            <form id="formSearch">
                                <!--搜索框-->
                                <div class="header-search pull-right">
                                    <input id="txtbSrSTitle" name="txtbSrSTitle" type="text" placeholder="标题/发件人姓名" style="margin-top: 0px; height: 39px; line-height: 35px;">
                                    <button type="button" style="top: 5px;" data-bind="click:$root.search">
                                        <i class="fa fa-search"></i>
                                    </button>
                                </div>
                            </form>

                        </div>

                    </div>

                </div>


                <!-- 上一页/下一页 当前数据-->
                <div class="btn-group pull-right inbox-paging">
                    <a href="javascript:void(0);" data-bind=" click: prevPage" class="btn btn-default btn-sm"><strong><i class="fa fa-chevron-left"></i></strong></a>
                    <a href="javascript:void(0);" data-bind=" click: nextPage" class="btn btn-default btn-sm"><strong><i class="fa fa-chevron-right"></i></strong></a>
                </div>
                <!-- 显示页数 -->
                <span class="pull-right" style="margin-top: 5px;">
                    <input id="toPage" type="text" data-bind="value:pageIndex,event:{change:$root.changePageIndex }" style="width: 30px; font-size: 15px;" />
                    / <span style="font-size: 15px;" data-bind="html:totalPages"></span></span>
            </div>
            <!-- Mails List add by yzp 10.24  update by yzp -->
            <div id="MailsListMessage" style="display: none;"></div>

            <table id="inbox-table" class="table table-striped table-hover checkboxs">

                <tbody data-bind="foreach: recordSet">

                    <tr data-bind="css:$root.isReading($data)">
                        <!-- checkbox ，没有设置data-bind -->
                        <td class="inbox-table-icon">
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" name="mailSelector" class="checkbox style-2" data-bind="value: Id" /><span></span></label>
                                <input type="hidden" data-bind="value: Id, attr: { id: Id }" />
                            </div>
                        </td>

                        <td class="center"><i class='fa  fa-envelope-o '></i></td>

                        <td id="sendName" data-bind="click: $root.goToMail" class="inbox-data-from hidden-xs hidden-sm">
                            <div data-bind="text: $root.GetText(SSenderName,SRecName)">
                            </div>
                        </td>

                        <td class="inbox-data-message" data-bind="click: $root.goToMail">

                            <div>
                                <span data-bind="text: STitle"></span>
                            </div>
                        </td>
                        <!-- 附件标志       -->
                        <td class="inbox-data-attachment hidden-xs">
                            <div data-bind="css:$root.IsShowAttachmentIcon($data)">
                                <a href="#" rel="tooltip" data-placement="left" data-original-title="rocketlaunch.jpg, timelogs.xsl" class="txt-color-darken">
                                    <i class="fa fa-paperclip fa-lg"></i></a>

                            </div>
                        </td>
                        <!-- 来信时间 -->
                        <td class="inbox-data-date hidden-xs" style="width: 160px;">
                            <div data-bind="text:Tms.formatDateTime(DSendtime)"></div>
                        </td>

                    </tr>
                </tbody>
            </table>

        </div>
        <!--end 列表-->

        <!-- Chosen mail -->
        <div id="MailDetail" style="padding-left: 10px; display: none;">
            <div data-bind="with:NodeValue">
                <div>
                    <!-- 标题 -->
                    <div class="email-open-header">
                        <div class="row">
                            <div class="col-sm-9">
                                <h2 data-bind="text: STitle" style="float: left;"></h2>
                            </div>
                            <div class="col-sm-3 ">
                                <button type="button" class="close" data-bind="click:$root.goToList">
                                    <i class="fa  fa-times "></i>
                                </button>
                            </div>
                        </div>
                    </div>
                    <!-- 来信人 -->
                    <div class="inbox-info-bar">
                        <div class="row">
                            <!-- 发件人地址 -->
                            <div class="col-sm-9" style="margin-bottom: 5px;">
                                <!--发件人姓名 -->
                                发件人：<strong data-bind="text: SSenderName"></strong>
                                <!-- 发件时间 -->
                                <span class="hidden-mobile" style="padding-left: 30px;"><i data-bind="text:Tms.formatDateTime( DSendtime)"></i></span>
                            </div>
                            <div class="col-sm-9">
                                <!--收件人姓名 -->
                                收件人：<strong data-bind="text: SRecName"></strong>
                            </div>
                            <!-- 回复 -->
                            <div class="col-sm-3 text-right" style="margin-top: -20px">
                                <div class="btn-group text-left">
                                    <button class="btn btn-primary btn-sm " data-bind="click:$root.Repply">
                                        <i class="fa fa-reply"></i>回信
                                    </button>

                                </div>

                            </div>
                        </div>
                    </div>
                </div>
                <div class="inbox-message">
                    <p class="message" data-bind="html: SContent" />
                </div>


            </div>
            <!--附件栏新加于10.17 test-->
            <div id="attachmentid">
                <div class="panel panel-success">
                    <div class="panel-heading">附件</div>
                    <div class="panel-body">
                        <table>
                            <tbody data-bind="foreach:AttchmentrecordSet">
                                <tr>
                                    <td class="" data-bind="text:SAttachmentName"></td>
                                    <td><a data-bind="attr:{href:SUrl,target:'_blank'}">下载</a></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                </div>
            </div>
        </div>

        <!-- 写信/回信 -->
        <div id="MailMessageModal" style="display: none;">
            <h2 class="email-open-header"><strong>写信</strong>
                <span class="label txt-color-white"></span>
                <button type="button" class="close" data-bind="click:$root.goToList">
                    <i class="fa  fa-times "></i>
                </button>
            </h2>
            <input type="hidden" id="txtbID" />
            <form class="form-horizontal" id="formMail">

                <!-- to -->
                <div class="inbox-info-bar no-padding">

                    <div class="row">
                        <div class="form-group">
                            <label class="control-label" style="margin-left: 30px;"><strong>收件人: </strong></label>
                            <div style="width: 50%; float: left;">
                                <input type="text" class="form-control" id="txtbIUserID" name="txtbIUserID" placeholder="请填写收件人信息" />
                            </div>

                            <div style="float: right; width: 250px;">
                                <div style="margin-top: 5px; float: right; position: relative; margin-right: 40px; width: 60px;">
                                    <select id="txtbIRevType" name="txtbIRevType">
                                        <option value="@ViewBag.UserType">--请选择--</option>
                                        <option value="1">学生</option>
                                        <option value="2">教师</option>
                                        <option value="3">管理员</option>
                                    </select>
                                </div>
                                <label class="control-label" style="margin-right: 5px; float: right">
                                    <strong>收件人类型:</strong>
                                </label>
                            </div>


                        </div>
                    </div>
                </div>

                <!-- 标题 -->
                <div class="inbox-info-bar no-padding">
                    <div class="row">
                        <div class="form-group">
                            <label class="control-label " style="margin-left: 30px;"><strong>主&nbsp;&nbsp;&nbsp;&nbsp;题:</strong></label>
                            <div style="width: 50%; float: left;">
                                <input id='txtbSTitle' name='txtbSTitle' placeholder='邮件主题' class="form-control" type="text">
                                <em><a href="javascript:void(0);" class="show-next" rel="tooltip" data-placement="bottom" data-original-title="附件">
                                    <i class="fa fa-paperclip fa-lg"></i></a></em>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 附件 -->
                <div id="Apenddexid" class="inbox-info-bar no-padding " style="display: none">
                    <div class="row">
                        <div class="form-group">
                            <label class="control-label" style="margin-left: 30px;"><strong>附&nbsp;&nbsp;&nbsp;&nbsp;件:</strong></label>
                            <div class="col-md-8">

                                <div id="bootstrapped-fine-uploader" style="width: 120px;"></div>
                                <table>
                                    <tbody id="existedAttachements">
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>


                <!-- 信件内容 -->
                <div class="inbox-message no-padding">
                    <div id="editor" style="height: 300px; width: 100%">
                    </div>

                </div>


                <!-- 按钮组 -->
                <div class="inbox-compose-footer">



                    <button data-loading-text="&lt;i class='fa fa-refresh fa-spin'&gt;&lt;/i&gt; &nbsp; Saving..." class="btn btn-info" type="button"
                        id="btnSaveAsDraftModel" data-bind="click:SavaDraft">
                        存草稿<i class="fa fa-arrow-circle-right fa-lg"></i>
                    </button>


                    <button data-loading-text="&lt;i class='fa fa-refresh fa-spin'&gt;&lt;/i&gt; &nbsp; Sending..." class="btn btn-primary pull-right" type="button" id="btnSaveOrUpdateModel" data-bind=" click: $root.SendNormalEmail">
                        发送 <i class="fa fa-arrow-circle-right fa-lg"></i>
                    </button>
                </div>


            </form>
        </div>

    </div>


</div>

<link href="~/CSS/jquery.toast.min.css" rel="stylesheet" />
@section script{
    <script src="~/Scripts/jquery.validate-vsdoc.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/Scripts/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/Scripts/ueditor/ueditor.all.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/js/plugin/delete-table-row/delete-table-row.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/js/plugin/summernote/summernote.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/js/plugin/select2/select2.min.js"></script>
    <script src="~/Js/bootstrap/bootstrap3-typeahead.js"></script>
    <script src="~/Scripts/Jcrop/jquery.fineuploader-3.1.min.js"></script>
    <script src="~/Js/jquery.toast.min.js"></script>
    <script src="~/Js/Email.js"></script>
}

